<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> Arkanoid 3D </title>
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<script language="JavaScript" src="Alladyn.js"></script>
<script language="JavaScript">
<!--
var l=193,t=193,wektor=[4,-2],I,o,O,pozX,pozY;
function mm(e){
var e=ie?event:e;
O=e[Y];
o=e[X];
pozX=o-W/2+165;
pozX<=35?pozX=0:pozX>=330?pozX=330:0;
pozY=O-H/2+165;
pozY<=0?pozY=0:pozY>=330?pozY=330:0;
vlay['pal3'].vpos(pozX,0);
vlay['pal4'].vpos(pozX,390);
vlay['pal1'].vpos(0,pozY);
vlay['pal2'].vpos(390,pozY);
}

function move(){
if((l+wektor[0]+15>=390||l+wektor[0]<=10)&&t+wektor[1]+15>=pozY&&t+wektor[1]<=pozY+70){wektor[0]=-wektor[0]}
if((t+wektor[1]+15>=390||t+wektor[1]<=10)&&l+wektor[0]+15>=pozX&&l+wektor[0]<=pozX+70){wektor[1]=-wektor[1]}
vlay['ball'].vpos(l+=wektor[0],t+=wektor[1]);
if(l<-15||l>400||t>400||t<-15){I=clearInterval(~~I);alert('LOOSE');}
}

function init(){
Alladyn();
W=ie?document.body.clientWidth:window.innerWidth;
H=ie?document.body.clientHeight:window.innerHeight;
Y=ie?'y':'pageY';
X=ie?'x':'pageX';
vlay['blat'].vpos(W/2-200,H/2-200);
vlay['blat'].vclip(0,400,400,0);
with(Al.N('pal1',10,vlay['blat'])){vpos(0,165);vHTML('<img src="paletka2.gif">');}
with(Al.N('pal2',10,vlay['blat'])){vpos(390,165);vHTML('<img src="paletka2.gif">');}
with(Al.N('pal3',70,vlay['blat'])){vpos(165,0);vHTML('<img src="paletka1.gif">');}
with(Al.N('pal4',70,vlay['blat'])){vpos(165,390);vHTML('<img src="paletka1.gif">');}
with(Al.N('ball',15,vlay['blat'])){vpos(192,192);vHTML('<img src="ball.gif">');}
document.onmousemove=mm;
I=setInterval("move()",20);
}
//-->
</script>
</head>

<body onload="init()">
<div id="blat" style="position:absolute;top:100;left:100;width:400;height:400;background-color:#CCCCCC"></div>
</body>
</html>
